var t = require("../common/index.js");

Component({
    properties: {
        data: {
            type: Object
        },
        floorIndex: {
            type: Number
        }
    },
    data: {
        current: 0,
        duration: 800,
        autoplay: !0,
        interval: 4000,
        indicatorDots: !1,
        circular: !0
    },
    methods: {
        changeCurrent: function (t) {
            var e = t.detail.current;
            this.setData({
                current: e
            });
        },
        goLink: function (e) {
            console.log('slider e', e)
            var a = e.currentTarget.dataset,
                d = e.currentTarget.offsetTop,
                r = a.item,
                o = r.linkType,
                i = r.data,
                n = a.positionIndex
            console.log('o', o)
            if (o == 6) {
                var url = encodeURIComponent(r.linkUrl);
                wx.navigateTo({
                    url: '/pages/webview/index?url=' + url,
                })
            } else if (o == 'notice') {
                var p = this.data.floorIndex;
                (0, t.goLink)({
                    type: "notice",
                    data: {
                        type: o,
                        item: r
                    },
                    saOption: {
                        componentName: "slider",
                        floorIndex: p,
                        positionIndex: n,
                        offsetTop: d
                    }
                });
            } else if (o == 'product') {
                var p = this.data.floorIndex;
                (0, t.goLink)({
                    type: "ad",
                    data: {
                        type: o,
                        item: r
                    },
                    saOption: {
                        componentName: "slider",
                        floorIndex: p,
                        positionIndex: n,
                        // timestamp: s,
                        offsetTop: d
                    }
                });
            } else if (o == 'article') {
                var p = this.data.floorIndex;
                (0, t.goLink)({
                    type: "multitype",
                    data: {
                        type: o,
                        item: r
                    },
                    saOption: {
                        componentName: "slider",
                        floorIndex: p,
                        positionIndex: n,
                        // timestamp: s,
                        offsetTop: d
                    }
                });
            } else if (o == 'page') {
                var p = this.data.floorIndex;
                (0, t.goLink)({
                    type: "page",
                    data: {
                        type: o,
                        item: r
                    },
                    saOption: {
                        componentName: "slider",
                        floorIndex: p,
                        positionIndex: n,
                        // timestamp: s,
                        offsetTop: d
                    }
                });
            }
        }
    }
});